package com.group;

import com.entity.Poker;
import com.entity.PokerType;
import com.filter.SameTypeGroupFilter;
import com.filter.SerialNumberGroupFilter;
import com.mike.median.util.PokerList;
import com.mike.median.util.PokerUtil;

import java.util.List;

/**
 * 清一色 策略算法
 */
public class FlushStrategy implements ITypeStrategy{
    @Override
    public PokerType getPokerType(PokerList<Poker> pokers) {
        PokerType result = new PokerType(pokers);
        result.setPoker_type_enum(PokerType.POKER_TYPE_ENUM.清一色);
        result.setPokerNum(PokerUtil.getPokerNum(pokers));
        return result;
    }

    @Override
    public boolean isTrue(PokerList<Poker> pokers) {
        return (new SameTypeGroupFilter(pokers).filter())&&(!new SerialNumberGroupFilter(pokers).filter());
    }
}
